package com.neutech.controller;

import com.neutech.mapper.MenuMapper;
import com.neutech.service.MenuService;
import com.neutech.service.UserService;
import com.neutech.vo.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@CrossOrigin
@RestController//可以省略Respon

public class LoginController {
    @Autowired
    private UserService userService;
    @ResponseBody
    @RequestMapping("/login")
        public String getUser(@RequestParam Map map)

    {
        for (Object key : map.keySet()) {
            Object  value = map.get(key);
            map.put((String) key,value);
            System.out.println(key + " : " + value);
        }
        List list =userService.queryUser((String) map.get("account"),(String) map.get("password"),(String) map.get("radio"));
     if(list.size()>0)
        {
            System.out.println("登录成功！");
            return "登录成功";
        }
        else
            return "登录失败";
    }
}
